﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FacadeSingTowerMall;
using DTOSingTowerMall;
using System.Data;

namespace WebFormSingTowerMall
{
    public partial class Feedback : System.Web.UI.Page
    {
        FeedbackFacade feeds = new FeedbackFacade();

        protected void Page_Load(object sender, EventArgs e)
        {
            //IEnumerable<IFeedback> feedbacks = from s in feedbacks select new { User = s.UserName, Email = s.email, Subject = s.Subject, Comment = s.Description };
            
            if (!IsPostBack)
            {
                GridViewFeedback.DataSource = from s in feeds.GetFeedbacks() select new { User = s.UserName, Email = s.email, Subject = s.Subject, Comment = s.Description };
                //GridViewFeedback.DataSource = feeds.GetFeedbacks();
                GridViewFeedback.DataBind();
                
            }

        }

        /*
        protected void GridViewFeedback_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridViewFeedback.DataSource = feeds.GetFeedbacks();//feeds.retriveFeedbacks();
            GridViewFeedback.PageIndex = e.NewPageIndex;
            GridViewFeedback.DataBind();                
        }
        */

    }
}